package com.pg.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.pg.mapper.SysjMapper;
import com.pg.service.SysjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;

/**
 * <p>
 * 实验数据 服务类
 * </p>
 *
 * @author likl
 * @since 2020-07-06
 */
@Service
@DS("proxyDs")
@Primary
public class SysjServiceImpl implements SysjService {

    @Autowired
    private SysjMapper sysjMapper;

    @Override
    public int jxtxCount(HashMap<String, Object> sysjMap) {
        String supplierCode = (String) sysjMap.get("supplierCode");
        String categoryType = (String) sysjMap.get("categoryCode");
        Date startTime = (Date) sysjMap.get("startTime");
        Date endTime = (Date) sysjMap.get("endTime");
        return sysjMapper.jxtxCount(supplierCode, categoryType, startTime, endTime);
    }

    @Override
    public int ldcjsyCount(HashMap<String, Object> sysjMap) {

        String supplierCode = (String) sysjMap.get("supplierCode");
        String categoryType = (String) sysjMap.get("categoryCode");
        Date startTime = (Date) sysjMap.get("startTime");
        Date endTime = (Date) sysjMap.get("endTime");
        return sysjMapper.ldcjsyCount(supplierCode, categoryType, startTime, endTime);
    }

    @Override
    public int gpnsdyCount(HashMap<String, Object> sysjMap) {

        String supplierCode = (String) sysjMap.get("supplierCode");
        String categoryType = (String) sysjMap.get("categoryCode");
        Date startTime = (Date) sysjMap.get("startTime");
        Date endTime = (Date) sysjMap.get("endTime");
        return sysjMapper.gpnsdyCount(supplierCode, categoryType, startTime, endTime);
    }

    @Override
    public int jbfdCount(HashMap<String, Object> sysjMap) {
        String supplierCode = (String) sysjMap.get("supplierCode");
        String categoryType = (String) sysjMap.get("categoryCode");
        Date startTime = (Date) sysjMap.get("startTime");
        Date endTime = (Date) sysjMap.get("endTime");
        return sysjMapper.jbfdCount(supplierCode, categoryType, startTime, endTime);
    }
}
